package org.zebra.web.websocket;

import javax.servlet.http.HttpServletRequest;

/**
 * @author zhanghongbin
 */
public final class DefaultTokenHandler implements TokenHandler {

    @Override
    public LoginInfo getLoginInfo(HttpServletRequest httpServletRequest) {
        String token = httpServletRequest.getParameter("token");
        if (token == null) return null;
        LoginInfo loginInfo = new LoginInfo();
        loginInfo.setId(token);
        loginInfo.setType(token);
        return loginInfo;
    }
}
